
package org.finegold.core.netty.core.model;

import lombok.Data;

/**
 * Description: 响应对象
 *
 * @author QinYueFeng
 * @since: 1.0
 * Create Date Time: 2018/7/4 16:23
 * Update Date Time:
 * @see
 */
@Data
public class ServerResponse {

    /**
     * 模块号
     */
    private short module;

    /**
     * 命令号
     */
    private short cmd;

    /**
     * 结果码
     */
    private int stateCode = ResultCode.SUCCESS;

    /**
     * 数据
     */
    private byte[] data;

    public ServerResponse() {
    }

    public ServerResponse(ServerRequest message) {
        this.module = message.getModule();
        this.cmd = message.getCmd();
    }

	public ServerResponse(short module, short cmd, int stateCode,byte[] data) {
		this.module = module;
		this.cmd = cmd;
		this.data = data;
		this.stateCode = stateCode;
	}
    public ServerResponse(short module, short cmd, int stateCode) {
        this.module = module;
        this.cmd = cmd;
        this.stateCode = stateCode;
    }
}
